<template>
  <div>
    <jc-bar prve-btn @prve="$router.replace({ path: '/my' })" home-btn>
      <v-spacer />
    </jc-bar>
    <v-main>
      <v-container>
        <v-card class="mb-2" v-for="(item, index) in list" :key="index">
          <v-card-title>
            {{ item.versoion }}
          </v-card-title>
          <v-card-subtitle>
            {{ handleDateFormat(item.update, "yyyy-mm-dd hh:MM:ss") }}
          </v-card-subtitle>
          <v-card-text v-html="item.context"></v-card-text>
        </v-card>
      </v-container>
    </v-main>
  </div>
</template>

<script>
import JcBar from "../../layout/JcBar";
import { getBbkzItem } from "../../api/cloudbase-bbkz";
import { dateFormat } from "../../utils/common";

export default {
  name: "index",
  components: { JcBar },
  data() {
    return {
      list: [],
    };
  },
  async mounted() {
    this.init();
  },
  methods: {
    async init() {
      try {
        const list = await getBbkzItem(100, 1);
        this.list = list.data;
      } catch (e) {}
    },
    handleDateFormat(date, format) {
      return dateFormat(date, format);
    },
  },
};
</script>

<style scoped></style>
